<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<html>
<head>
<title>澳斯浪廷会员平台</title>
<link href="<c:url value='/resources/css/css.css'/>" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="<c:url value='/resources/js/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/validate.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/js/mask.js'/>"></script>
</head>
<body leftmargin="0">
	<c:if test="${not empty newUserName}">
		<script>
			alert("注册成功，新注册的会员ID是：${newUserName}");
		</script>
	</c:if>
<div class="main">
<div class="width_l">
    <iframe src="menu.action" frameborder="0" width="250" height="100%" class="menu"></iframe>
</div>    
    <div class="right">
    <div class="width_r">
        <div class="menu_r">
            <ul>
                <li><a href="index.action">首页</a></li>
                <li><a href="information.action">消息</a></li>
                <li><a href="notice.action">公告中心</a></li>
                <li><a href="news.action">新闻中心</a></li>
                <li><a href="inbox.action">收件箱</a></li>
                <li><a href="tomail.action">写邮件</a></li>
                <li><a href="sent.action">已发送</a></li>
                <li><a href="${ctx}/exit.action">安全退出</a></li> 
            </ul>
        </div>
        <div class="news_top"><img src="<c:url value='/resources/images/top.jpg'/>" /></div>
        <div class="news">
          <h4>会员审核</h4>
    	  <div class="zhye">
              <div class="zhye_l">激活豆：${userAccount.activMoney }　|　咖啡豆：${userAccount.bonusMoney }</div>
              <div class="zhye_r"><a href="exchange.action"><img src="<c:url value='/resources/images/duihuan.jpg'/>"/></a></div>
          </div>
          <div class="vvbt">
          <table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
		  <tr>
		    <td width="100" class="vvd">会员ID </td>
		    <td width="150" class="vvd">注册时间</td>
		    <td width="60" class="vvd">级别</td>
		    <td width="100" class="vvd">推荐人</td>
		    <td width="60" class="vvd">区域</td>
		    <td width="100" class="vvd">安置人</td>
		    <td width="150" class="vvd">开通时间</td>
		    <td width="120" class="vvd">业务管理</td>
		  </tr>
		</table></div>
		<table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
			<c:forEach var="recommend" items="${page.result }">
			  <tr>
			    <td width="100" class="vv">${recommend.userAccount}</td>
			    <td width="140" class="vv"><fmt:formatDate value="${recommend.registerDate}" pattern="yyyy-M-dd HH:mm:ss"/>
			    </td>
			    <td width="60" class="vv">
				    <c:forEach var="level" items="${levelList }">
			            <c:if test="${level.code eq recommend.level}">${level.name }</c:if>
			        </c:forEach> 
			    </td>
			    <td width="100" class="vv"> ${recommend.recommendId}</td>
			    <td width="70" class="vv">
			    	<c:forEach var="local" items="${locationList }">
		            	<c:if test="${local.code eq recommend.location}">${local.name }</c:if>
		            </c:forEach> 
			    </td>
			    <td width="100" class="vv">${recommend.parentId}</td>
			    <td width="140" class="vv"><fmt:formatDate value="${recommend.activityDate}" pattern="yyyy-M-dd HH:mm:ss"/>
			    </td>
			    <td width="130" class="vv">
			    	<c:choose>
			    		<c:when test="${empty recommend.activityDate}">
						    <a href="javascript:void(0);" onclick="doActivity('${recommend.userId}');"><font color="#ed1b2f">激活</font></a> | 
						    <a href="javascript:void(0);" onclick="doDelete('${recommend.userId}');">删除</a><!-- 没有激活前可以删除 -->
			    		</c:when>
			    		<c:otherwise>
			    			已激活
			    		</c:otherwise>
			    	</c:choose>
			    </td>
			  </tr>
			</c:forEach>
		</table>
		<%@ include file="/common/turnpage.jsp" %>
		<%-- <table width="840" border="0" align="center" cellpadding="0" cellspacing="0">
		  <tr>
		    <td class="page">总共：${page.totalPageCount } 页　<span>1</span>　2　3　4　5　转到 <select name=""></select> 页</td>
		  </tr>
		</table> --%>
        </div> 
        <div class="news_down"><img src="<c:url value='/resources/images/down.jpg'/>" /></div>
    </div>
    </div>
</div>
</body>
</html>
<script type="text/javascript">
$(function(){
	
});

function doActivity(usreId){
	var url = "${ctx}/activityuser.action";
	$(document).mask("系统处理中，请稍后......");
  	 $.ajax({
			type:'POST',
			url:url,
			data: "user.userId="+usreId,
			dataType:"json",
			success: function(data,status){
				if($.trim(data)!=''){
					if($.trim(data) == '1'){
						alert("对不起，您的激活豆不足，不能激活该用户");
					}else if($.trim(data) == '2'){
						alert("对不起，您的VV豆不足，不能激活该用户");
					}else if($.trim(data) == 0){
						alert("激活成功!");
					}else{
						alert("运行异常，请重试！");
					}
					//$("#bankProvince").html(data);
					window.location.href = "${ctx}/check.action"; 
				}
			},
			error: function(data,status,e){
				alert(e.name);
			}
		});
}

function doDelete(usreId){
	if(window.confirm("您确定要删除该用户吗？"))
		window.location.href = "${ctx}/deleteuser.action?id="+usreId;
}

function frontpage(pageNo){
	window.location.href = "${ctx}/check.action?pageNo="+pageNo;
}

function nextpage(pageNo){
	window.location.href = "${ctx}/check.action?pageNo="+pageNo;
}

</script>